<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>

</head>
<body>
    <div id="app">
        <p v-on:click="printMsg()">点击事件绑定</p>
        <p @click="printMsg()">点击事件绑定</p>
        <p v-on="{mousedown:printFunA,mouseup:printFunB}">统一多事件绑定</p>
        <p @mousedown="printFunA()" @mouseup="printFunB()">多事件绑定</p>
        <p v-on:click="[printFunA(),printFunB()]">一个事件统一多回调绑定</p>
        <p>info:{{info}}</p>
        <input type="button" value="info-随机值行内" v-on:click="info=Math.random()">
        <input type="button" value="info-随机值调用" v-on:click="setRandom()">
        <div>
            <span v-on:click="num--">+</span>
            <span>{{num}}</span>
            <span v-on:click="num++">-</span>
        </div>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                num:0,
                msg:"haha",
                info:"默认数据"
            },
            methods:{
                printMsg:function(){
                    console.log(1111);
                },
                printFunA:function(){
                    console.log("FunA")
                },
                printFunB:function(){
                    console.log("FunB")
                },
            }
        })
    </script>
</body>
</html>